<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of readDASURL</title>
  <meta name="keywords" content="readDASURL">
  <meta name="description" content="READDASURL attempts to read the DAS URL within the specified timeout">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../index.html">Home</a> &gt;  <a href="index.html">code</a> &gt; readDASURL.m</div>

<!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for code&nbsp;<img alt=">" border="0" src="../right.png"></a></td></tr></table>-->

<h1>readDASURL
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>READDASURL attempts to read the DAS URL within the specified timeout</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function [xmlStruct, xml, status] = readDASURL(dasUrl,timeout) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> READDASURL attempts to read the DAS URL within the specified timeout
 
 
 SYNTAX: [xmlStruct, xml, status] = readDASURL(dasUrl,timeout)
          dasUrl - any DAS url
          timeout - maximum allowed time for reading, in miliseconds</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="urlread2.html" class="code" title="function [string,status] = urlread2(urlChar,method,params,timeout);">urlread2</a>	URLREAD Returns the contents of a URL as a string.</li></ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="executeDASCommand.html" class="code" title="function [xmlStruct, xml,status,dasUrl] = executeDASCommand(serverURL,varargin)">executeDASCommand</a>	EXECUTEDASCOMMAND is the DAS Version 1.53 API.</li><li><a href="getDASRegistryOptions.html" class="code" title="function [optList] = getDASRegistryOptions(varargin)">getDASRegistryOptions</a>	GETDASREGISTRYOPTIONS extract the list of search options in DAS Registry</li><li><a href="searchDASRegistry.html" class="code" title="function [xmlStruct, xml,status] = searchDASRegistry(varargin)">searchDASRegistry</a>	SEARCHDASREGISTRY executes the specified query to interact with DAS Registry</li></ul>
<!-- crossreference -->


<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [xmlStruct, xml, status] = readDASURL(dasUrl,timeout)</a>
0002 <span class="comment">% READDASURL attempts to read the DAS URL within the specified timeout</span>
0003 <span class="comment">%</span>
0004 <span class="comment">%</span>
0005 <span class="comment">% SYNTAX: [xmlStruct, xml, status] = readDASURL(dasUrl,timeout)</span>
0006 <span class="comment">%          dasUrl - any DAS url</span>
0007 <span class="comment">%          timeout - maximum allowed time for reading, in miliseconds</span>
0008 
0009 <span class="comment">%          xmlStruct - struct output from parsing DAS XML response</span>
0010 <span class="comment">%          xml - DAS XML response from the server</span>
0011 <span class="comment">%          status - 1 (success), 0 (fail). If status = 0, either is bad url</span>
0012 <span class="comment">%                    or not able to read in the defined timeout</span>
0013 <span class="comment">%                    If status = 1 and xmlStruct = -1, parsing problem</span>
0014 <span class="comment">%</span>
0015 <span class="comment">% See also DAS_GUI, SEARCHREGISTRY_GUI</span>
0016 <span class="comment">%</span>
0017 <span class="comment">%    DASMiner: DAS library and browser for Matlab.</span>
0018 <span class="comment">%    Diogo Veiga, March 2008.</span>
0019 
0020    
0021     <span class="keyword">try</span>
0022         [xml, status] = <a href="urlread2.html" class="code" title="function [string,status] = urlread2(urlChar,method,params,timeout);">urlread2</a>(dasUrl,[], [],timeout);
0023         <span class="keyword">if</span> (isempty(xml) &amp;&amp; status)
0024             xml = <span class="string">'DAS Server response: empty'</span>;
0025         <span class="keyword">end</span>
0026     <span class="keyword">catch</span>
0027         <span class="comment">%error('Problem reading url. Check settings of the query and try again.');</span>
0028         xmlStruct = -1;
0029         <span class="keyword">return</span>;
0030     <span class="keyword">end</span>
0031     <span class="keyword">if</span> (status == 0)
0032         <span class="comment">%error('Invalid url for the data source');</span>
0033         xmlStruct = -1;
0034         <span class="keyword">return</span>;
0035     <span class="keyword">end</span>
0036 
0037     <span class="keyword">try</span>
0038         xmlStruct = xml_parseany(xml);
0039     <span class="keyword">catch</span>
0040         <span class="comment">%error('Problem parsing XML response.');</span>
0041         xmlStruct = -1;
0042         <span class="keyword">return</span>;
0043     <span class="keyword">end</span></pre></div>
<hr><address>Generated on Tue 17-Feb-2009 16:59:45 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> &copy; 2003</address>
</body>
</html>